enable gui to load Qt provided meta catalogs. (#360)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Wed, 29 May 2019 19:13:53 +0000 (13:13 -0600)
committerGitHub <noreply@github.com>
Wed, 29 May 2019 19:13:53 +0000 (13:13 -0600)
QTranslate::load fails to load a meta catalog if
the absolute file name is given as the filename parameter, and
the directory parameter is omitted.
It succeeds if the file name is provided as the filename parameter
and the directory is provided as the diretory parameter.

This should resolve #359.

gui/mainwindow.cc

index 6401581f1ce72d09fa8f1a75d2ff79b8355b2353..1f85152d73c296376ee65b61cdf7ab023abe92cd 100644 (file)
@@ -314,10 +314,8 @@ void MainWindow::switchTranslator(QTranslator& translator, const QString& filena
   // remove the old translator
   qApp->removeTranslator(&translator);
 
-  QString full_filename(langPath_ + "/" + filename);
-
   // load the new translator
-  if (translator.load(full_filename)) {
+  if (translator.load(filename, langPath_)) {
     qApp->installTranslator(&translator);
   }
 }